package com.example.pixelyear.utils.dialog

import android.content.Context
import android.widget.TextView
import com.example.pixelyear.Interface.OnClickListener
import com.example.pixelyear.R
import com.example.pixelyear.utils.extension.setOnDoubleClickListener

class OnlyTextViewDialog(context: Context) : BaseDialog(context) {
    private lateinit var textView: TextView
    private var click: OnClickListener? = null
    override fun getLayoutID(): Int {
        return R.layout.dialog_textview
    }

    override fun initAny() {
        textView = rootView as TextView
        textView.setOnDoubleClickListener {
            click?.click()
        }
    }

    fun show(msg: String) {
        super.show()
        if (this::textView.isInitialized)
            textView.text = msg
    }

    fun setonClickListener(onClickListener: OnClickListener) {
        this.click = onClickListener
    }


}
